package com.loongtech.bi.action.authManagement;

import com.loongtech.core.util.RetCode;

/**
 * Author: yuri
 * Description: 返回包装类
 * Date: 15:42 2017/4/28
 */

public class ResultData <T> {
    private Integer code;
    private T msg;

    public ResultData() {

    }

    public ResultData(Integer code, T msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResultData<String> success () {
        return new ResultData<>( RetCode.eSuccess.getErrorcode(),RetCode.eSuccess.getErrorMsg());
    }

    public static ResultData<String> otherException () {
        return new ResultData<>( RetCode.eOtherException.getErrorcode(),RetCode.eOtherException.getErrorMsg());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getMsg() {
        return msg;
    }

    public void setMsg(T msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ResultData{" +
                "code=" + code +
                ", msg=" + msg +
                '}';
    }
}
